package com.hq.ims.userpc.controller.app;

import com.hq.ims.data.annotation.UserOperationMonitor;
import com.hq.ims.data.utils.LocalConstant;
import com.hq.ims.data.vo.BusInfoFeedbackMapstruct;
import com.hq.ims.data.vo.BusInfoNotificationMapstruct;
import com.hq.ims.userpc.busservice.app.AppBusInfoTrackService;
import com.hq.utils.vo.ReturnVo;
import com.hq.web.annotations.GetJsonValue;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author cx
 * @date 2024/11/26 11:21:02
 * @description 经营信息app跟踪反馈Controller
 */
@Api(tags = "经营信息跟踪反馈")
@RestController
@RequestMapping(LocalConstant.SYS_TYPE_USER_APP_URL_PREFIX + "/appBusInfoTrack")
public class AppBusInfoTrackController {

    @Resource
    private AppBusInfoTrackService appBusInfoTrackService;

    @UserOperationMonitor
    @ApiOperation(value = "填写反馈", consumes = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParams({
    })
    @PostMapping(value = "/fillFeedback", consumes = MediaType.APPLICATION_JSON_VALUE)
    public ReturnVo<Boolean> fillFeedback(@RequestBody BusInfoFeedbackMapstruct.SaveVo saveVo) {
        return appBusInfoTrackService.fillFeedback(saveVo);
    }

    @ApiOperation(value = "反馈情况查询", consumes = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParams({
    })
    @PostMapping(value = "/getFeedbackSituation", consumes = MediaType.APPLICATION_JSON_VALUE)
    public ReturnVo<List<BusInfoFeedbackMapstruct.FeedbackDetailVo>> getFeedbackSituation(@GetJsonValue(zh = "数据ID") String busiInfoId) {
        return appBusInfoTrackService.getFeedbackSituation(busiInfoId);
    }

    @ApiOperation(value = "查询接收情况", consumes = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParams({
    })
    @PostMapping(value = "/getReceiveSituation", consumes = MediaType.APPLICATION_JSON_VALUE)
    public ReturnVo<List<BusInfoNotificationMapstruct.ReceiveSituationVo>> getReceiveSituation(@GetJsonValue(zh = "经营信息id") String busiInfoId) {
        return appBusInfoTrackService.getReceiveSituation(busiInfoId);
    }
}
